package com.muse.aaa;

public class Test {

    public static void main(String[] args) {


    }

    private boolean search(Node node, int searchValue) {
        if (node == null) {
            return false;
        }

        int value = node.getValue();

        // 进行左右子树的判断
        if (searchValue == value) {
            return true;
        } else if (searchValue < value) { // 向左查找
            return search(node.getLeft(), searchValue);
        } else { // 像右查找
            return search(node.getRight(), searchValue);
        }
    }
}

class Node {
    private Node left;

    private Node right;

    private int value ;

    public Node getLeft() {
        return left;
    }

    public void setLeft(Node left) {
        this.left = left;
    }

    public Node getRight() {
        return right;
    }

    public void setRight(Node right) {
        this.right = right;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }
}